package com.itheima.myreflect2.Student;

import com.sun.corba.se.impl.presentation.rmi.DynamicMethodMarshallerImpl;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * @program: Myset
 * @description:字符缓冲输入流
 * @author: xuejingjing
 * @create: 2021-06-15 21:36
 **/
public class Charstream9 {
    public static void main(String[] args) throws IOException {
        //字符缓冲输入流
        BufferedReader br = new BufferedReader(new FileReader("a.txt"));

        //   一次读取多个字符
        //    private static int defaultCharBufferSize = 8192;
        //    private static int defaultExpectedLineLength = 80;
        //读取数据
        char[] chars = new char[1024];
        int len;
        while((len = br.read(chars)) != -1){
            System.out.println(new String(chars,0,len));
        }
        br.close();
    }
}
